<?php
include('dbConnect.inc.php');
$loadType=$_POST['loadType'];
$loadId=$_POST['loadId'];

if($loadType=="state"){
	$sql="select * from kieuxe where mahangsx='".$loadId."' order by tenkieuxe asc";
}else{
	$sql="select * from loaixe where makieuxe='".$loadId."' order by tenloaixe asc";
}
$res=mysql_query($sql);
$check=mysql_num_rows($res);
if($check > 0){
	$HTML="";
	while($row=mysql_fetch_array($res)){
		$HTML.="<option value='".$row['0']."'>".$row['1']."</option>";
	}
	echo $HTML;
}
?>